package com.ruoyi.oa.controller;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.oa.domain.ComboxSelect;
import com.ruoyi.oa.service.DeptService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Authorization;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api("这是oa的部门相关控制器")
@RestController
@RequestMapping("oa/dept")
public class DeptController {

    @Autowired
    DeptService deptService;

    /**
     * url : Get请求oa/dept/list
     * @return 部门列表
     */
    @ApiOperation(value="部门模块部门数据获取用于select", notes = "oa部门")
    @GetMapping("list")
    public AjaxResult getDepList(){

        List<ComboxSelect> comlist = deptService.findAllDept();
        return AjaxResult.success(comlist);
    }
}
